home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / STUTTGART / LANG / C / LIB / UNIXLIB37B / !UnixLib37 / src / stdio / c / fputs < prev    next >
Text File  |  1996-11-09  |  824b  |  38 lines

  1. /****************************************************************************
  2.  *
  3.  * $Source: /unixb/home/unixlib/source/unixlib37/src/stdio/c/RCS/fputs,v $
  4.  * $Date: 1996/04/19 21:32:42 $
  5.  * $Revision: 1.1 $
  6.  * $State: Rel $
  7.  * $Author: simon $
  8.  *
  9.  * $Log: fputs,v $
  10.  * Revision 1.1  1996/04/19 21:32:42  simon
  11.  * Initial revision
  12.  *
  13.  ***************************************************************************/
  14.  
  15. static const char rcs_id[] = "$Id: fputs,v 1.1 1996/04/19 21:32:42 simon Rel $";
  16.  
  17. #include <stdio.h>
  18.  
  19. __STDIOLIB__
  20.  
  21. int
  22. fputs (register const char *s, register FILE * f)
  23. {
  24.   register int c = 0;
  25.  
  26.   if (!s)
  27.     s = (const char *) __null;
  28.  
  29.   while (c = *s++)
  30.     if ((c = putc (c, f)) < 0)
  31.       break;
  32.  
  33.   if (f->o_ptr > f->o_base && !!(f->flag & _IOLBF) && __flsbuf (-1, f) < 0)
  34.     return (-1);
  35.  
  36.   return (c);
  37. }
  38.